1. Field of the Invention
The present claimed invention relates generally to the field of computer systems and computer operating systems. More particularly, embodiments of the present claimed invention relate to subscribing and to publishing events with an event channel from the user level and kernel level.
2. Related Art
A computer system can be generally divided into four components: the hardware, the operating system, the application programs and the users. The hardware (e.g., central processing unit (CPU), memory and input/output (I/O) devices) provide the basic computing resources. The application programs (e.g., database systems, games business programs (database systems, etc.) define the ways in which these resources are used to solve computing problems. The operating system controls and coordinates the use of the hardware resources among the various application programs for the various users. In doing so, one goal of the operating system is to make the computer system convenient to use. A secondary goal is to use the hardware in an efficient manner.
The Unix operating system is one example of an operating system that is currently used by many enterprise computer systems. Unix was designed to be a time-sharing system, with a hierarchical file system, which supported multiple processes. A process is the execution of a program and consists of a pattern of bytes that the CPU interprets as machine instructions (text), data and stack. A stack defines a set of hardware registers or a reserved amount of main memory that is used for arithmetic calculations.
The Unix operating system consists of two separable parts: the “kernel” and the “system programs.” Systems programs consist of system libraries, compilers, interpreters, shells and other such programs that provide useful functions to the user. The kernel is the central controlling program that provides basic system facilities. The Unix kernel creates and manages processes, provides functions to access file-systems, and supplies communications facilities.
The Unix kernel is the only part of Unix that a user cannot replace. The kernel also provides the file system, CPU scheduling, memory management and other operating-system functions by responding to “system-calls.” Conceptually, the kernel is situated between the hardware and the users. System calls are used by the programmer to communicate with the kernel to extract computer resource information. The robustness of the Unix kernel allows system hardware and software to be dynamically configured to the operating system while applications programs are actively functional without having to shut-down the underlying computer system.
Thus, when system hardware or software resource changes are implemented in a computer system having the Unix operating system, the kernel is typically configured or reconfigured to recognize the changes. These changes are then made available to user applications in the computer system. Furthermore, as system errors and faults occur in the underlying operating system, the kernel is able to identify these errors and faults and make them available to applications that these error and faults may affect. Applications typically make system calls by way of “system traps” to specific locations in the computer hardware (sometimes called an “interrupt” location or vector) to collect information on these system errors. Specific parameters are passed to the kernel on the stack and the kernel returns with a code in specific registers indicating whether the action required by the system call was successfully completed or not.
FIG. 1 is a block diagram illustration of an exemplary prior art computer system 100. The computer system 100 is connected to an external storage device 180 and to an external drive device 120 through which computer programs can be loaded into computer system 100. The external storage device 180 and external drive 120 are connected to the computer system 100 through respective bus lines. The computer system 100 further includes main memory 130 and processor 110. The drive 120 can be a computer program product reader such a floppy disk drive, an optical scanner, a CD-ROM device, etc.
FIG. 1 additionally shows memory 130 including a kernel level memory 140. Memory 130 can be virtual memory which is mapped onto physical memory including RAM or a hard drive, for example. During process execution, a programmer programs data structures in the memory at the kernel level memory 140. User applications 160A and 160B are coupled to the computer system 100 to utilize the kernel memory 140 and other system resources in the computer system 100. In the computer system 100 shown in FIG. 1, when kernel events occur, each of the applications 160A and 160B have to independently perform poll or query operations to become aware of these events. Furthermore, each application has to initiate system calls to the kernel 140 to extract information on a particular event.
This typically results in the applications blocking or waiting for the kernel 140 to extract event information. Having the applications 160A and 160B independently issue system calls to the kernel to extract kernel event information further requires the applications to always preempt the kernel to extract event information. This can be inefficient, time consuming and costly. It may also require the applications to terminate or suspend other processes while preempting the kernel to extract kernel event information.